// ==== 引入request.ts ====
import request from "../utils/request"


// 后台--RESTful ---> GEtAll, GEtone, POST, PUT, DELETE 

// 获取所有！
const getAll = (params?:any) =>{
    return request({
        method: 'get',
        url: 'basic/branchareas/',
        params
    })
}

// 获取一个 
const getOne = (id:any)=>{
    return request({
        method: 'get',
        url: `basic/branchareas/${id}/`
    })
}

// 添加 
const add = (data:any) =>{
    return request({
        method: 'post',
        url: 'basic/branchareas/',
        data
    })
}

// 修改 
const edit = (id:any, data:any) =>{
    return request({
        method: 'put',
        url: `basic/branchareas/${id}/`,
        data
    })
}

// 删除
const del = (id:any) =>{
    return request({
        method: 'delete',
        url: `basic/branchareas/${id}/`
    })
}

// 暴露 
export default {
    getAll, getOne, add, edit,del
}